An upper bound on the heat flux for infinite-Prandtl-number convection between two parallel plates is determined for the cases of no-slip and free-slip boundary conditions. For no-slip the large-Rayleigh-number ($\hbox{\it Ra}$) scaling for the Nusselt number is consistent with $\hbox{\it Nu}\,{<}\,c\, \hbox{\it Ra}^{1/3}$, as predicted by Chan (1971). However, his commonly accepted picture of an infinite hierarchy of multiple boundary layer solutions smoothly approaching this scaling is incorrect. Instead, we find a novel terminating sequence in which the optimal asymptotic scaling is achieved with a three-boundary-layer solution. In the case of free-slip, we find an asymptotic scaling of $\hbox{\it Nu}\,{<}\,c\, \hbox{\it Ra}^{5/12}$, corroborating the conservative estimate obtained in Plasting & Ierley (2005). Here the infinite hierarchy of multiple-boundary-layer solutions obtains, albeit with anomalous features not previously encountered. Thus for neither boundary condition does the optimal solution conform to the well-established models of finite-Prandtl-number convection (Busse 1969 b), plane Couette flow, and plane or circular Poiseuille flow (Busse 1970). We reconcile these findings with a suitable continuation from no-slip to free-slip, discovering that the key distinction – finite versus geometric saturation – is entirely determined by the singularity, or not, of the initial, single-boundary-layer, solution. It is proposed that this selection principle applies to all upper bound problems.